package org.example.day20240903文件操作;

import java.io.*;

public class Main5 {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("tongnian.mp3");
        BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
        FileOutputStream fileOutputStream = new FileOutputStream("tongnian2.mp3");
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);

        byte[] arr = new byte[1024];
        int len = bufferedInputStream.read(arr);
        while (len > 0){
            bufferedOutputStream.write(arr,0,len);
            len = bufferedInputStream.read(arr);
        }

        bufferedInputStream.close();
        fileInputStream.close();
        bufferedOutputStream.close();
        fileOutputStream.close();
    }
}
